import http from '@/utils/http'

//检测手机号是否被占用
export const getDocheckPhoneAPI = (phone:any)=>{
return  http.get(`/api/users/${phone}`)
}

//根据手机号获取验证码
export const getDoSendMsgCodeAPI = (phone:any)=>{
  return  http.get(`/api/users/${phone}/code`)
  }
//验证码校验
export const getDocheckCodeAPI = (phone:any,code:any)=>{
  return  http.get(`/api/users/${phone}/verifycode`,{
    params:{
      code
    }
  })
  }
//用户注册
export const getDoFinishRegisterAPI = (phone:any,password:any)=>{
  return  http.post('/api/users/register',{
      phone,password
  })
  }
//用户账号登录
export const userLoginAPI = (account:any,password:any)=>{
  return  http.post('/api/sessions/account',{
    account,password
  })
  }

  //获取用户基本信息
  export const getUserInfoAPI = ()=>{
    return  http.get('/api/users/self',)
  }

  //退出登录
  export const exitLoginAPI = ()=>{
    return  http.delete('/api/sessions',)
  }


